<style type="text/css">
#ar{
    position:absolute;
    top:5px;
    right:0px;
    border:6px inset #b0b5bd;
    text-align:center;
    color:#000066;
    background-color:#d0d6df;
    cursor:move;
    height:50px;
    width:340px;
}
</style>
<div id="ar"></div>
<br><br>
<?php echo CYui::init(true, true); $ajax = CYui::buildAjaxOptions('/widget/ajaxcall', 'ar'); ?>
<h2>ActiveTree Demo</h2>
<br><br>
  <div class="yiiForm">
    <?php echo CHtml::beginForm(); ?>
    <?php echo CYui::activeTree($tableDemo, 'intField', 'treeDemo', true, true, 'folder', $ajax); ?>
      <br><br><?php echo CHtml::activeLabelEx($tableDemo, 'intField').': '.$tableDemo->intField; ?>
    <br><br>
    <div class="action">
        <?php echo CHtml::submitButton('Post selected item'); ?>
    </div>
  </div><!-- yiiForm -->
    <?php echo CHtml::endForm(); ?>
<br><br>
<table class="dataGrid">
    <tr>
        <th colspan="4"><h3>activeTree</h3></th>
    </tr>
    <tr>
        <th>Param</th>
        <th>Type</th>
        <th>Description</th>
        <th>Required / default</th>
    </tr>
    <tr>
        <td><b>$model</b></td>
        <td>CModel</td>
        <td>data model</td>
        <td align="center">+</td>
    </tr>
    <tr>
        <td><b>$attribute</b></td>
        <td>string</td>
        <td>attribute</td>
        <td align="center">+</td>
    </tr>
    <tr>
        <td><b>$tableTree</b></td>
        <td>string</td>
        <td>
            Table that contains nodes and has the structure:<br>
            <ul>
            <li><b>id</b> - int</li>
            <li><b>parentId</b> - int</li>
            <li><b>name</b> - string</li>
            </ul>            
        </td>
        <td align="center">+</td>
    </tr>
    <tr>
        <td><b>$editable</b></td>
        <td>boolean</td>
        <td>support for add, edit or remove nodes<br>drag-drop now not supported</td>
        <td align="center">false</td>
    </tr>
    <tr>
        <td><b>$asyncMode</b></td>
        <td>boolean</td>
        <td>async loading node</td>
        <td align="center">true</td>
    </tr>
    <tr>
        <td><b>$visualStyle</b></td>
        <td>string</td>
        <td>"default", "folder", "menu"</td>
        <td align="center">`default`</td>
    </tr>
    <tr>
        <td><b>$ajax</b></td>
        <td>array</td>
        <td>ajax call when select new value for widget</td>
        <td align="center">NULL</td>
    </tr>
    <tr>
        <td colspan="4">
            <?php echo CYui::codeHighlight('  echo CYui::activeTree($model, `intField`, `tableDemo`, false, true, `folder`);', 'php'); ?>
        </td>
    </tr>
</table>